<?php


abstract class BaseDoacaos extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $contribuinte_id;


	
	protected $empcontribuinte_id;


	
	protected $valor = 0;


	
	protected $periodo_id;


	
	protected $dt_confirmacao;


	
	protected $dt_vencimento;


	
	protected $situacao_id = 0;


	
	protected $hist_contatos;


	
	protected $cobrador_id;


	
	protected $cod_barras;


	
	protected $created_at;


	
	protected $updated_at;


	
	protected $usuario_id;

	
	protected $aContribuintes;

	
	protected $aEmpcontribuintes;

	
	protected $aPeriodos;

	
	protected $aSituacaos;

	
	protected $aCobradors;

	
	protected $aUsuarios;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getContribuinteId()
	{

		return $this->contribuinte_id;
	}

	
	public function getEmpcontribuinteId()
	{

		return $this->empcontribuinte_id;
	}

	
	public function getValor()
	{

		return $this->valor;
	}

	
	public function getPeriodoId()
	{

		return $this->periodo_id;
	}

	
	public function getDtConfirmacao($format = 'Y-m-d')
	{

		if ($this->dt_confirmacao === null || $this->dt_confirmacao === '') {
			return null;
		} elseif (!is_int($this->dt_confirmacao)) {
						$ts = strtotime($this->dt_confirmacao);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [dt_confirmacao] as date/time value: " . var_export($this->dt_confirmacao, true));
			}
		} else {
			$ts = $this->dt_confirmacao;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getDtVencimento($format = 'Y-m-d')
	{

		if ($this->dt_vencimento === null || $this->dt_vencimento === '') {
			return null;
		} elseif (!is_int($this->dt_vencimento)) {
						$ts = strtotime($this->dt_vencimento);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [dt_vencimento] as date/time value: " . var_export($this->dt_vencimento, true));
			}
		} else {
			$ts = $this->dt_vencimento;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getSituacaoId()
	{

		return $this->situacao_id;
	}

	
	public function getHistContatos()
	{

		return $this->hist_contatos;
	}

	
	public function getCobradorId()
	{

		return $this->cobrador_id;
	}

	
	public function getCodBarras()
	{

		return $this->cod_barras;
	}

	
	public function getCreatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->created_at === null || $this->created_at === '') {
			return null;
		} elseif (!is_int($this->created_at)) {
						$ts = strtotime($this->created_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
			}
		} else {
			$ts = $this->created_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getUpdatedAt($format = 'Y-m-d H:i:s')
	{

		if ($this->updated_at === null || $this->updated_at === '') {
			return null;
		} elseif (!is_int($this->updated_at)) {
						$ts = strtotime($this->updated_at);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true));
			}
		} else {
			$ts = $this->updated_at;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getUsuarioId()
	{

		return $this->usuario_id;
	}

	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = DoacaosPeer::ID;
		}

	} 
	
	public function setContribuinteId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->contribuinte_id !== $v) {
			$this->contribuinte_id = $v;
			$this->modifiedColumns[] = DoacaosPeer::CONTRIBUINTE_ID;
		}

		if ($this->aContribuintes !== null && $this->aContribuintes->getId() !== $v) {
			$this->aContribuintes = null;
		}

	} 
	
	public function setEmpcontribuinteId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->empcontribuinte_id !== $v) {
			$this->empcontribuinte_id = $v;
			$this->modifiedColumns[] = DoacaosPeer::EMPCONTRIBUINTE_ID;
		}

		if ($this->aEmpcontribuintes !== null && $this->aEmpcontribuintes->getId() !== $v) {
			$this->aEmpcontribuintes = null;
		}

	} 
	
	public function setValor($v)
	{

		if ($this->valor !== $v || $v === 0) {
			$this->valor = $v;
			$this->modifiedColumns[] = DoacaosPeer::VALOR;
		}

	} 
	
	public function setPeriodoId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->periodo_id !== $v) {
			$this->periodo_id = $v;
			$this->modifiedColumns[] = DoacaosPeer::PERIODO_ID;
		}

		if ($this->aPeriodos !== null && $this->aPeriodos->getId() !== $v) {
			$this->aPeriodos = null;
		}

	} 
	
	public function setDtConfirmacao($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [dt_confirmacao] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->dt_confirmacao !== $ts) {
			$this->dt_confirmacao = $ts;
			$this->modifiedColumns[] = DoacaosPeer::DT_CONFIRMACAO;
		}

	} 
	
	public function setDtVencimento($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [dt_vencimento] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->dt_vencimento !== $ts) {
			$this->dt_vencimento = $ts;
			$this->modifiedColumns[] = DoacaosPeer::DT_VENCIMENTO;
		}

	} 
	
	public function setSituacaoId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->situacao_id !== $v || $v === 0) {
			$this->situacao_id = $v;
			$this->modifiedColumns[] = DoacaosPeer::SITUACAO_ID;
		}

		if ($this->aSituacaos !== null && $this->aSituacaos->getId() !== $v) {
			$this->aSituacaos = null;
		}

	} 
	
	public function setHistContatos($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->hist_contatos !== $v) {
			$this->hist_contatos = $v;
			$this->modifiedColumns[] = DoacaosPeer::HIST_CONTATOS;
		}

	} 
	
	public function setCobradorId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->cobrador_id !== $v) {
			$this->cobrador_id = $v;
			$this->modifiedColumns[] = DoacaosPeer::COBRADOR_ID;
		}

		if ($this->aCobradors !== null && $this->aCobradors->getId() !== $v) {
			$this->aCobradors = null;
		}

	} 
	
	public function setCodBarras($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cod_barras !== $v) {
			$this->cod_barras = $v;
			$this->modifiedColumns[] = DoacaosPeer::COD_BARRAS;
		}

	} 
	
	public function setCreatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_at !== $ts) {
			$this->created_at = $ts;
			$this->modifiedColumns[] = DoacaosPeer::CREATED_AT;
		}

	} 
	
	public function setUpdatedAt($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->updated_at !== $ts) {
			$this->updated_at = $ts;
			$this->modifiedColumns[] = DoacaosPeer::UPDATED_AT;
		}

	} 
	
	public function setUsuarioId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->usuario_id !== $v) {
			$this->usuario_id = $v;
			$this->modifiedColumns[] = DoacaosPeer::USUARIO_ID;
		}

		if ($this->aUsuarios !== null && $this->aUsuarios->getId() !== $v) {
			$this->aUsuarios = null;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->contribuinte_id = $rs->getInt($startcol + 1);

			$this->empcontribuinte_id = $rs->getInt($startcol + 2);

			$this->valor = $rs->getFloat($startcol + 3);

			$this->periodo_id = $rs->getInt($startcol + 4);

			$this->dt_confirmacao = $rs->getDate($startcol + 5, null);

			$this->dt_vencimento = $rs->getDate($startcol + 6, null);

			$this->situacao_id = $rs->getInt($startcol + 7);

			$this->hist_contatos = $rs->getString($startcol + 8);

			$this->cobrador_id = $rs->getInt($startcol + 9);

			$this->cod_barras = $rs->getString($startcol + 10);

			$this->created_at = $rs->getTimestamp($startcol + 11, null);

			$this->updated_at = $rs->getTimestamp($startcol + 12, null);

			$this->usuario_id = $rs->getInt($startcol + 13);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 14; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Doacaos object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(DoacaosPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			DoacaosPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
    if ($this->isNew() && !$this->isColumnModified(DoacaosPeer::CREATED_AT))
    {
      $this->setCreatedAt(time());
    }

    if ($this->isModified() && !$this->isColumnModified(DoacaosPeer::UPDATED_AT))
    {
      $this->setUpdatedAt(time());
    }

		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(DoacaosPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aContribuintes !== null) {
				if ($this->aContribuintes->isModified()) {
					$affectedRows += $this->aContribuintes->save($con);
				}
				$this->setContribuintes($this->aContribuintes);
			}

			if ($this->aEmpcontribuintes !== null) {
				if ($this->aEmpcontribuintes->isModified()) {
					$affectedRows += $this->aEmpcontribuintes->save($con);
				}
				$this->setEmpcontribuintes($this->aEmpcontribuintes);
			}

			if ($this->aPeriodos !== null) {
				if ($this->aPeriodos->isModified()) {
					$affectedRows += $this->aPeriodos->save($con);
				}
				$this->setPeriodos($this->aPeriodos);
			}

			if ($this->aSituacaos !== null) {
				if ($this->aSituacaos->isModified()) {
					$affectedRows += $this->aSituacaos->save($con);
				}
				$this->setSituacaos($this->aSituacaos);
			}

			if ($this->aCobradors !== null) {
				if ($this->aCobradors->isModified()) {
					$affectedRows += $this->aCobradors->save($con);
				}
				$this->setCobradors($this->aCobradors);
			}

			if ($this->aUsuarios !== null) {
				if ($this->aUsuarios->isModified()) {
					$affectedRows += $this->aUsuarios->save($con);
				}
				$this->setUsuarios($this->aUsuarios);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = DoacaosPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += DoacaosPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aContribuintes !== null) {
				if (!$this->aContribuintes->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aContribuintes->getValidationFailures());
				}
			}

			if ($this->aEmpcontribuintes !== null) {
				if (!$this->aEmpcontribuintes->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aEmpcontribuintes->getValidationFailures());
				}
			}

			if ($this->aPeriodos !== null) {
				if (!$this->aPeriodos->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aPeriodos->getValidationFailures());
				}
			}

			if ($this->aSituacaos !== null) {
				if (!$this->aSituacaos->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aSituacaos->getValidationFailures());
				}
			}

			if ($this->aCobradors !== null) {
				if (!$this->aCobradors->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aCobradors->getValidationFailures());
				}
			}

			if ($this->aUsuarios !== null) {
				if (!$this->aUsuarios->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aUsuarios->getValidationFailures());
				}
			}


			if (($retval = DoacaosPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = DoacaosPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getContribuinteId();
				break;
			case 2:
				return $this->getEmpcontribuinteId();
				break;
			case 3:
				return $this->getValor();
				break;
			case 4:
				return $this->getPeriodoId();
				break;
			case 5:
				return $this->getDtConfirmacao();
				break;
			case 6:
				return $this->getDtVencimento();
				break;
			case 7:
				return $this->getSituacaoId();
				break;
			case 8:
				return $this->getHistContatos();
				break;
			case 9:
				return $this->getCobradorId();
				break;
			case 10:
				return $this->getCodBarras();
				break;
			case 11:
				return $this->getCreatedAt();
				break;
			case 12:
				return $this->getUpdatedAt();
				break;
			case 13:
				return $this->getUsuarioId();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = DoacaosPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getContribuinteId(),
			$keys[2] => $this->getEmpcontribuinteId(),
			$keys[3] => $this->getValor(),
			$keys[4] => $this->getPeriodoId(),
			$keys[5] => $this->getDtConfirmacao(),
			$keys[6] => $this->getDtVencimento(),
			$keys[7] => $this->getSituacaoId(),
			$keys[8] => $this->getHistContatos(),
			$keys[9] => $this->getCobradorId(),
			$keys[10] => $this->getCodBarras(),
			$keys[11] => $this->getCreatedAt(),
			$keys[12] => $this->getUpdatedAt(),
			$keys[13] => $this->getUsuarioId(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = DoacaosPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setContribuinteId($value);
				break;
			case 2:
				$this->setEmpcontribuinteId($value);
				break;
			case 3:
				$this->setValor($value);
				break;
			case 4:
				$this->setPeriodoId($value);
				break;
			case 5:
				$this->setDtConfirmacao($value);
				break;
			case 6:
				$this->setDtVencimento($value);
				break;
			case 7:
				$this->setSituacaoId($value);
				break;
			case 8:
				$this->setHistContatos($value);
				break;
			case 9:
				$this->setCobradorId($value);
				break;
			case 10:
				$this->setCodBarras($value);
				break;
			case 11:
				$this->setCreatedAt($value);
				break;
			case 12:
				$this->setUpdatedAt($value);
				break;
			case 13:
				$this->setUsuarioId($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = DoacaosPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setContribuinteId($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setEmpcontribuinteId($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setValor($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setPeriodoId($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setDtConfirmacao($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setDtVencimento($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setSituacaoId($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setHistContatos($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setCobradorId($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setCodBarras($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setCreatedAt($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setUpdatedAt($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setUsuarioId($arr[$keys[13]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(DoacaosPeer::DATABASE_NAME);

		if ($this->isColumnModified(DoacaosPeer::ID)) $criteria->add(DoacaosPeer::ID, $this->id);
		if ($this->isColumnModified(DoacaosPeer::CONTRIBUINTE_ID)) $criteria->add(DoacaosPeer::CONTRIBUINTE_ID, $this->contribuinte_id);
		if ($this->isColumnModified(DoacaosPeer::EMPCONTRIBUINTE_ID)) $criteria->add(DoacaosPeer::EMPCONTRIBUINTE_ID, $this->empcontribuinte_id);
		if ($this->isColumnModified(DoacaosPeer::VALOR)) $criteria->add(DoacaosPeer::VALOR, $this->valor);
		if ($this->isColumnModified(DoacaosPeer::PERIODO_ID)) $criteria->add(DoacaosPeer::PERIODO_ID, $this->periodo_id);
		if ($this->isColumnModified(DoacaosPeer::DT_CONFIRMACAO)) $criteria->add(DoacaosPeer::DT_CONFIRMACAO, $this->dt_confirmacao);
		if ($this->isColumnModified(DoacaosPeer::DT_VENCIMENTO)) $criteria->add(DoacaosPeer::DT_VENCIMENTO, $this->dt_vencimento);
		if ($this->isColumnModified(DoacaosPeer::SITUACAO_ID)) $criteria->add(DoacaosPeer::SITUACAO_ID, $this->situacao_id);
		if ($this->isColumnModified(DoacaosPeer::HIST_CONTATOS)) $criteria->add(DoacaosPeer::HIST_CONTATOS, $this->hist_contatos);
		if ($this->isColumnModified(DoacaosPeer::COBRADOR_ID)) $criteria->add(DoacaosPeer::COBRADOR_ID, $this->cobrador_id);
		if ($this->isColumnModified(DoacaosPeer::COD_BARRAS)) $criteria->add(DoacaosPeer::COD_BARRAS, $this->cod_barras);
		if ($this->isColumnModified(DoacaosPeer::CREATED_AT)) $criteria->add(DoacaosPeer::CREATED_AT, $this->created_at);
		if ($this->isColumnModified(DoacaosPeer::UPDATED_AT)) $criteria->add(DoacaosPeer::UPDATED_AT, $this->updated_at);
		if ($this->isColumnModified(DoacaosPeer::USUARIO_ID)) $criteria->add(DoacaosPeer::USUARIO_ID, $this->usuario_id);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(DoacaosPeer::DATABASE_NAME);

		$criteria->add(DoacaosPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setContribuinteId($this->contribuinte_id);

		$copyObj->setEmpcontribuinteId($this->empcontribuinte_id);

		$copyObj->setValor($this->valor);

		$copyObj->setPeriodoId($this->periodo_id);

		$copyObj->setDtConfirmacao($this->dt_confirmacao);

		$copyObj->setDtVencimento($this->dt_vencimento);

		$copyObj->setSituacaoId($this->situacao_id);

		$copyObj->setHistContatos($this->hist_contatos);

		$copyObj->setCobradorId($this->cobrador_id);

		$copyObj->setCodBarras($this->cod_barras);

		$copyObj->setCreatedAt($this->created_at);

		$copyObj->setUpdatedAt($this->updated_at);

		$copyObj->setUsuarioId($this->usuario_id);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new DoacaosPeer();
		}
		return self::$peer;
	}

	
	public function setContribuintes($v)
	{


		if ($v === null) {
			$this->setContribuinteId(NULL);
		} else {
			$this->setContribuinteId($v->getId());
		}


		$this->aContribuintes = $v;
	}


	
	public function getContribuintes($con = null)
	{
				include_once 'lib/model/om/BaseContribuintesPeer.php';

		if ($this->aContribuintes === null && ($this->contribuinte_id !== null)) {

			$this->aContribuintes = ContribuintesPeer::retrieveByPK($this->contribuinte_id, $con);

			
		}
		return $this->aContribuintes;
	}

	
	public function setEmpcontribuintes($v)
	{


		if ($v === null) {
			$this->setEmpcontribuinteId(NULL);
		} else {
			$this->setEmpcontribuinteId($v->getId());
		}


		$this->aEmpcontribuintes = $v;
	}


	
	public function getEmpcontribuintes($con = null)
	{
				include_once 'lib/model/om/BaseEmpcontribuintesPeer.php';

		if ($this->aEmpcontribuintes === null && ($this->empcontribuinte_id !== null)) {

			$this->aEmpcontribuintes = EmpcontribuintesPeer::retrieveByPK($this->empcontribuinte_id, $con);

			
		}
		return $this->aEmpcontribuintes;
	}

	
	public function setPeriodos($v)
	{


		if ($v === null) {
			$this->setPeriodoId(NULL);
		} else {
			$this->setPeriodoId($v->getId());
		}


		$this->aPeriodos = $v;
	}


	
	public function getPeriodos($con = null)
	{
				include_once 'lib/model/om/BasePeriodosPeer.php';

		if ($this->aPeriodos === null && ($this->periodo_id !== null)) {

			$this->aPeriodos = PeriodosPeer::retrieveByPK($this->periodo_id, $con);

			
		}
		return $this->aPeriodos;
	}

	
	public function setSituacaos($v)
	{


		if ($v === null) {
			$this->setSituacaoId('null');
		} else {
			$this->setSituacaoId($v->getId());
		}


		$this->aSituacaos = $v;
	}


	
	public function getSituacaos($con = null)
	{
				include_once 'lib/model/om/BaseSituacaosPeer.php';

		if ($this->aSituacaos === null && ($this->situacao_id !== null)) {

			$this->aSituacaos = SituacaosPeer::retrieveByPK($this->situacao_id, $con);

			
		}
		return $this->aSituacaos;
	}

	
	public function setCobradors($v)
	{


		if ($v === null) {
			$this->setCobradorId(NULL);
		} else {
			$this->setCobradorId($v->getId());
		}


		$this->aCobradors = $v;
	}


	
	public function getCobradors($con = null)
	{
				include_once 'lib/model/om/BaseCobradorsPeer.php';

		if ($this->aCobradors === null && ($this->cobrador_id !== null)) {

			$this->aCobradors = CobradorsPeer::retrieveByPK($this->cobrador_id, $con);

			
		}
		return $this->aCobradors;
	}

	
	public function setUsuarios($v)
	{


		if ($v === null) {
			$this->setUsuarioId(NULL);
		} else {
			$this->setUsuarioId($v->getId());
		}


		$this->aUsuarios = $v;
	}


	
	public function getUsuarios($con = null)
	{
				include_once 'lib/model/om/BaseUsuariosPeer.php';

		if ($this->aUsuarios === null && ($this->usuario_id !== null)) {

			$this->aUsuarios = UsuariosPeer::retrieveByPK($this->usuario_id, $con);

			
		}
		return $this->aUsuarios;
	}

} 